﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="EditCourseActivity.aspx.cs"
    Inherits="ZX.WebApp.TR.EditCourseActivity" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        body
        {
             background-color:#eeeeee;    
        }
        tr
        {
            line-height: 20px;
        }
        td
        {
            font-size: 12px;
        }
        #Text51
        {
            height: 42px;
            width: 190px;
        }
        .style20
        {
            height: 32px;
            width: 169px;
        }
        #Textarea1
        {
            width: 188px;
            height: 41px;
        }
        .style21
        {
            width: 220px;
        }
        .style22
        {
            width: 184px;
        }
        #Textarea2
        {
            width: 188px;
            height: 40px;
        }
        #Textarea3
        {
            width: 186px;
            height: 49px;
        }
        #Textarea4
        {
            width: 185px;
            height: 49px;
        }
        .style25
        {
            height: 25px;
            width: 264px;
        }
        .style26
        {
            height: 30px;
            width: 264px;
        }
        .style27
        {
            height: 32px;
            width: 264px;
        }
        .style29
        {
            height: 25px;
            width: 235px;
        }
        .style31
        {
            height: 32px;
            width: 235px;
        }
        #Textarea5
        {
            height: 78px;
        }
        #Textarea6
        {
            height: 78px;
        }
        #Textarea7
        {
            height: 76px;
        }
        #Textarea8
        {
            height: 243px;
        }
        .style34
        {
            height: 30px;
            width: 245px;
        }
        #CoursePrepare1
        {
            height: 25px;
            width: 182px;
        }
        #CoursePrepare2
        {
            height: 25px;
            width: 182px;
        }
        #CoursePrepare3
        {
            height: 25px;
            width: 182px;
        }
        #CoursePrepare4
        {
            height: 26px;
            width: 182px;
        }
        #CoursePrepare5
        {
            height: 25px;
            width: 182px;
        }
        .style35
        {
            width: 240px;
            height: 51px;
        }
        .style36
        {
            height: 51px;
            width: 169px;
        }
        #CoursePrepare7
        {
            height: 50px;
            width: 150px;
        }
        #CoursePrepare8
        {
            height: 50px;
            width: 150px;
        }
        #CoursePrepare6
        {
            height: 50px;
            width: 150px;
        }
        #CoursePrepare9
        {
            height: 170px;
            width: 150px;
            margin-left: 0px;
        }
        .style37
        {
            width: 240px;
        }
        #Table1
        {
            width: 614px;
        }
        #btnCancel
        {
            width: 35px;
        }
        .style39
        {
            width: 220px;
            height: 12px;
        }
        .style40
        {
            width: 184px;
            height: 12px;
        }
        #CoursePrepare10
        {
            height: 31px;
            width: 550px;
        }
        #Review1
        {
            width: 530px;
            height: 30px;
            margin-left: 0px;
        }
        #txtReview
        {
            width: 218px;
        }
        #txtReview0
        {
            width: 225px;
        }
        #txtReviewtime
        {
            width: 226px;
        }
        .style50
        {
            height: 30px;
            width: 235px;
        }
        .style51
        {
            width: 196px;
        }
        .style59
        {
            width: 159px;
            height: 12px;
        }
        .style60
        {
            width: 159px;
        }
        .style61
        {
            height: 32px;
            width: 171px;
        }
        .style80
        {
            border-bottom: black 1px solid;
            border-top-style: none;
            border-right-style: none;
            border-left-style: none;
            background-color: transparent;
            height: 16px;
            width: 232px;
        }
        .style81
        {
            width: 26px;
        }
        .style83
        {
            height: 32px;
            width: 402px;
        }
        .style84
        {
            height: 25px;
            width: 402px;
        }
        .style85
        {
            height: 30px;
            width: 402px;
        }
        .style86
        {
            width: 57px;
        }
        .style87
        {
            width: 57px;
            height: 30px;
        }
        .style88
        {
            width: 74px;
        }
        .style89
        {
            width: 74px;
            height: 30px;
        }
        .style90
        {
            height: 30px;
            width: 252px;
        }
        .tableContent
        {
            border-collapse: collapse;
        }
        .tableContent th
        {
            font-weight:normal;
            border: solid 1px #D4DBE2;
            background-color:#F2F8FF;
            white-space: nowrap;
            line-height:20px;
            text-align:center;
        }
        .tableContent td
        {
            border: solid 1px #D4DBE2;
            text-align: left;
        }
        .style96
        {
            width: 600px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/reset-fonts-grids/reset-fonts-grids.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/menu/assets/skins/sam/menu.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <!-- OPTIONAL: JSON Utility (for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <!-- OPTIONAL: Calendar (enables calendar editors) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <!-- Source files -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/button/button-min.js"></script>    
      <!--<script type="text/javascript" src="../scripts/yui_2.9.0/build/treeview/treeview-min.js"></script>-->
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/resize/resize-min.js"></script>
</head>
<body class="yui-skin-sam">
    <form id="form1" runat="server" enableviewstate="false">
    <div id="button">
        <table style="width: 600px" border="0.7" class="tableContent">
            <tr>
                <td class="style83">
                    分享人
                </td>
                <td class="style31">
                    <input id="txtusername" runat="server" name="TrMessageIssueID" type="text" class="style80"
                        readonly="readonly" />
                </td>
                <td class="style83">
                    分享日期
                </td>
                <td class="style27">
                    <input id="txtaddtime" runat="server" name="MessageType1" type="text" class="style80"
                        readonly="readonly" size="20" />
                </td>
            </tr>
            <tr>
                <td class="style84">
                    <label id="Label2">
                        活动名称</label>
                </td>
                <td class="style29">
                    <input id="txtactivityname" runat="server" name="IssueTitle" type="text" style="border-bottom: black 1px solid;
                        border-top-style: none; border-right-style: none; border-left-style: none; background-color: transparent; width:179px;
                        height: 16px;" readonly="readonly" />
                    <button type="button" id="btnSelect" name="btnSelect" runat="server">
                        选择
                    </button>
                </td>
                <td class="style84">
                    课程名称
                </td>
                <td class="style25">
                    <input id="txtcoursename" runat="server" name="MessageType" type="text" class="style80"
                        readonly="readonly" />
                </td>
            </tr>
            <tr>
                <td class="style85">
                    讲师
                </td>
                <td class="style50">
                    <input id="txtteachname" runat="server" name="IssueTitle" type="text" class="style80"
                        readonly="readonly" />
                </td>
                <td class="style85">
                    课程日期
                </td>
                <td class="style26">
                    <input id="txtcoursestartime" runat="server" name="IssueTitle" type="text" class="style80"
                        readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>
    <div style="width: 600px">
        <table class="tableContent" style="font-weight: normal; border: solid 1px #D4DBE2;
            background-color: #F2F8FF; white-space: nowrap; width: 600px;">
            <tr>
                <th align="center" style="font-family: 宋体; font-weight:bold;" class="style96">
                    我所学到的(请列出10点)
                    <input type="hidden" id="txtid" runat="server" name="IssueTitle" />
                    <input type="hidden" id="humanid" runat="server" name="TxtAreaExpectation" /> 
                    <input type="hidden" id="TxtAreaExpectation" runat="server" name="TxtAreaExpectation" />                    
                </th>
            </tr>
        </table>
    </div>
    <div id="div_data">
        <table style="width: 600px" class="tableContent">
            <tr>
                <td style="font-family: 隶书;" class="style86">
                    1,
                </td>
                <td class="style90">
                    <input id="course1" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
                <td style="font-family: 隶书;" class="style88">
                    2,
                </td>
                <td class="style34">
                    <input id="course2" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
            </tr>
            <tr>
                <td style="font-family: 隶书;" class="style86">
                    3,
                </td>
                <td class="style90">
                    <input id="course3" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
                <td style="font-family: 隶书;" class="style88">
                    4,
                </td>
                <td class="style34">
                    <input id="course4" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
            </tr>
            <tr>
                <td style="font-family: 隶书;" class="style87">
                    5,
                </td>
                <td class="style90">
                    <input id="course5" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
                <td style="font-family: 隶书;" class="style89">
                    6,
                </td>
                <td class="style34">
                    <input id="course6" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
            </tr>
            <tr>
                <td style="font-family: 隶书;" class="style86">
                    7,
                </td>
                <td class="style90">
                    <input id="course7" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
                <td style="font-family: 隶书;" class="style88">
                    8,
                </td>
                <td class="style34">
                    <input id="course8" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
            </tr>
            <tr>
                <td style="font-family: 隶书;" class="style86">
                    9,
                </td>
                <td class="style90">
                    <input id="course9" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
                <td style="font-family: 隶书;" class="style88">
                    10,
                </td>
                <td class="style34">
                    <input id="course10" runat="server" name="IssueTitle" type="text" class="style80" />
                </td>
            </tr>
        </table>
    </div>
    <div id="Div1">
        <table id="Table1" class="tableContent" style="width: 600px">
            <tr>
                <th align="center" class="style39" style="font-family: 宋体;font-weight:bold;">
                    我计划学以致用的
                </th>
                <th align="center" class="style40" style="font-family: 宋体;font-weight:bold;">
                    我立即学以致用的
                </th>
                <th align="center" class="style59" style="font-family: 宋体;font-weight:bold;">
                    我一定用好的
                </th>
            </tr>
            <tr>
                <td class="style21">
                    <table class="tableContent">
                        <tr>
                            <td align="left" class="style81" style="font-family: 隶书;">
                                1,
                            </td>
                            <td class="style61">
                                <textarea id="CoursePrepare1" runat="server" name="TrMessageIssueID" style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style81" style="font-family: 隶书;">
                                2,
                            </td>
                            <td class="style61">
                                <textarea id="CoursePrepare2" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style81" style="font-family: 隶书;">
                                3,
                            </td>
                            <td class="style61">
                                <textarea id="CoursePrepare3" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style81" style="font-family: 隶书;">
                                4,
                            </td>
                            <td class="style61">
                                <textarea id="CoursePrepare4" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" class="style81" style="font-family: 隶书;">
                                5,
                            </td>
                            <td class="style61">
                                <textarea id="CoursePrepare5" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="style22">
                    <table class="tableContent">
                        <tr>
                            <td align="center" class="style35" style="font-family: 隶书;">
                                1,
                            </td>
                            <td class="style36">
                                <textarea id="CoursePrepare6" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" class="style37" style="font-family: 隶书;">
                                2,
                            </td>
                            <td class="style20">
                                <textarea id="CoursePrepare7" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                        <tr>
                            <td align="center" class="style37" style="font-family: 隶书;">
                                3,
                            </td>
                            <td class="style20">
                                <textarea id="CoursePrepare8" runat="server" name="TrMessageIssueID" class="yui-area"
                                      style="overflow: hidden"   ></textarea>
                            </td>
                        </tr>
                    </table>
                </td>
                <td align="right" class="style60">
                    <table style="height: 125px; width: 184px;" class="tableContent">
                        <tr>
                            <td align="center" class="style51" style="font-family: 隶书;">
                                1,
                            </td>
                            <td class="style20">
                                <textarea id="CoursePrepare9" runat="server" name="TrMessageIssueID" class="yui-area"
                                    style="overflow: hidden"></textarea>
                            </td>
                        </tr>
                    </table>
                </td>
        </table>
    </div>
    <div id="Div2">
          <%=ReturnString %>
      <%-- <table   style="font-weight:normal;  border: solid 1px #D4DBE2;    background-color:#F2F8FF;    white-space: nowrap; width: 614px;"    
             line-height:20px;" ><tr><td class="style91">点评人</td><td class="style22">
                         <input id="txtReview" runat="server" name="IssueTitle0" type="text"  class="style80" readonly="readonly"  /></td>
             <td class="style92">点评时间</td><td class="style97">&nbsp;<input id="txtReviewtime" runat="server" name="IssueTitle1" type="text"  class="style80" readonly="readonly" /></td></tr></table>
  
         <table style="font-weight:normal;  border: solid 1px #D4DBE2;    background-color:#F2F8FF;    white-space: nowrap; width: 615px;" ><tr><td class="style74">点评内容</td><td class="style94">
                    <textarea id="Review1"  runat="server" name="TrMessageIssueID0" class="yui-area" style="overflow:hidden" ></textarea></td></tr> </table>
        --%> 
        </div>
    <div id="dialog1" class="yui-pe-content">
        <div class="hd">
            课程活动选择</div>
        <div class="bd">
            <iframe id="EditUIWindow" frameborder="0" src="" style="width: 100%; height: 100%;
                margin: 0px; padding: 0px;"></iframe>
        </div>
    </div>
    </form>
</body>
<script type="text/javascript">
    var queryString = function (key) {
        return (document.location.search.match(new RegExp("(?:^\\?|&)" + key + "=(.*?)(?=&|$)")) || ['', null])[1];
    }

    function Save() {
        var CourseShare = "5︽" + document.getElementById("CoursePrepare1").value + "︾"
                + "5︽" + document.getElementById("CoursePrepare2").value + "︾"
                + "5︽" + document.getElementById("CoursePrepare3").value + "︾"
                + "5︽" + document.getElementById("CoursePrepare4").value + "︾"
                + "5︽" + document.getElementById("CoursePrepare5").value + "︾"
                + "3︽" + document.getElementById("CoursePrepare6").value + "︾"
                + "3︽" + document.getElementById("CoursePrepare7").value + "︾"
                + "3︽" + document.getElementById("CoursePrepare8").value + "︾"
                + "1︽" + document.getElementById("CoursePrepare9").value;
        var Course = "0︽" + document.getElementById("course1").value + "︾"
                + "0︽" + document.getElementById("course2").value + "︾"
                + "0︽" + document.getElementById("course3").value + "︾"
                + "0︽" + document.getElementById("course4").value + "︾"
                + "0︽" + document.getElementById("course5").value + "︾"
                + "0︽" + document.getElementById("course6").value + "︾"
                + "0︽" + document.getElementById("course7").value + "︾"
                + "0︽" + document.getElementById("course8").value + "︾"
                + "0︽" + document.getElementById("course9").value + "︾"
                + "0︽" + document.getElementById("course10").value;
        //︽︾
        var id = queryString("TrActivityCourseID");
        var type = queryString("type");
        var strcourseshare;
        var humanid = document.getElementById("humanid").value;
        var itype = 1;
        if (type == 1) {                                  //心得管理操作
            strcourseshare = Course + "︾" + CourseShare;   //获取心得信息内容
            id = document.getElementById("txtid").value;
        }
        else if (type == 2) {                             //点评管理操作
            //心得管理操作
            strcourseshare = Course + "︾" + CourseShare;   //获取心得信息内容
        }
        else if (type == 3) {
            var Review = document.getElementById("Review1").value;
            strcourseshare = Review;                      //获取点评内容  
        }
        var request = "CourceShareList.aspx?&CourseShare=" + encodeURI(strcourseshare) + "&ID=" + id + "&hid=" + humanid + "&type=" + type + "&itype=" + itype + "";
        YAHOO.util.Connect.asyncRequest('POST', request, {
            success: function (res) {
                var inventory;
                try {
                    inventory = res.responseText;
                    if (inventory == "1") {
                        alert("保存成功!");
                        parent.closeWin();
                    } else {
                        alert(inventory + "\n" + "数据保存失败!");
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("读取错误：" + error.statusText);
            }
        }, null);
    }
    //
    var fnSelect = function () {
        var EntityNames = 'V_TrActivityCourseX';
        document.getElementById("EditUIWindow").src = "SelectCourseActivity.aspx?&entity=" + EntityNames + "";
        YAHOO.example.container.dialog1.show();
    }
    YAHOO.example.init = function () {

        // "click" event handler for each Button instance
        function onButtonClick(p_oEvent) {
            YAHOO.log("You clicked button: " + this.get("id"), "info", "example1");
            switch (this.get("id")) {
                case "btnSelect":
                    fnSelect();
                    break;
                default:
                    fnSelect();
                    break;
            }
        }
        // "contentready" event handler for the "pushbuttonsfrommarkup" <fieldset>

        YAHOO.util.Event.onContentReady("button", function () {
            // Create Buttons using existing <input> elements as a data source
            var btnAddNew = new YAHOO.widget.Button("btnSelect");
            btnAddNew.on("click", onButtonClick);

        });


    } ();
    YAHOO.namespace("example.container");

    YAHOO.util.Event.onDOMReady(function () {
        // Define various event handlers for Dialog
        var handleSubmit = function () {
            var editwindow = document.getElementById("EditUIWindow");
            if (editwindow) {
                editwindow.contentWindow.fnSure();
            }
        };
        var handleCancel = function () {
            this.cancel();
        };
        var handleSuccess = function (o) {
            var response = o.responseText;
            response = response.split("<!")[0];
            document.getElementById("resp").innerHTML = response;
        };
        var handleFailure = function (o) {
            alert("Submission failed: " + o.status);
        };
        // Remove progressively enhanced content class, just before creating the module
        YAHOO.util.Dom.removeClass("dialog1", "yui-pe-content");
        // Instantiate the Dialog
        YAHOO.example.container.dialog1 = new YAHOO.widget.Dialog("dialog1",
							{ width: "550px",
							    height: "450px",
							    fixedcenter: true,
							    visible: false,
							    constraintoviewport: true,
							    buttons: [{ text: "保存", handler: handleSubmit, isDefault: true },
								      { text: "取消", handler: handleCancel}]
							});

        // Validate the entries in the form to require that both first and last name are entered
        YAHOO.example.container.dialog1.validate = function () {
            var data = this.getData();
            if (data.firstname == "" || data.lastname == "") {
                alert("Please enter your first and last names.");
                return false;
            } else {
                return true;
            }
        };
        // Wire up the success and failure handlers
        YAHOO.example.container.dialog1.callback = { success: handleSuccess,
            failure: handleFailure
        };
        // Render the Dialog
        YAHOO.example.container.dialog1.render();
        YAHOO.util.Event.addListener("btnSelect", "click", YAHOO.example.container.dialog1.show, YAHOO.example.container.dialog1, true);
    });
</script>
</html>
